user = 'cjw'
pwd = '123'





count = 1

while True: # 这里改用for循环的话，代码可以更精炼，而且可读性更好
    user_input = input('please input username').strip()
    pwd_input = input('please input pwd').strip()
    if count == 3:
        print('用户名或密码输错3次， 退出程序')
        break
    if not user_input == user or not pwd_input == pwd:
        print(f'用户名或密码错误输错{count}次,请重新输入')
        count += 1
        continue
    else:
        print('登录成功')
        break
